﻿using System;
using WebUI.BL.Products;
using WebUI.DAL;

namespace WebUI.AdminSite.Product
{
    public partial class ProductSizeCreate : System.Web.UI.Page
    {
        public string sizeno = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //sizeno = Request.QueryString["Id"];
                //if(sizeno != "" && sizeno != null)
                //    BindData(sizeno);
            }
        }

        //private void BindData(string sizeno)
        //{
        //    ProductSizeBL repository = new ProductSizeBL();
        //    var productsize = repository.GetProductSizeByNo(Convert.ToInt32(sizeno));
        //    txtSizeName.Text = productsize.SizeName;
        //    txtDesc.Text = productsize.SizeDesc;
        //    drpStatus.SelectedValue = productsize.Status;
        //}

        //protected void btnCreate_Click(object sender, EventArgs e)
        //{
        //    ProductSizeBL productsizebl = new ProductSizeBL();

        //    string sizename = txtSizeName.Text.Trim();
        //    string desc = txtDesc.Text.Trim();
        //    string status = drpStatus.SelectedValue;

        //    sizeno = Request.QueryString["Id"];
        //    tbl_ProductSize productsize = new tbl_ProductSize
        //    {
        //        SizeNo = sizeno==string.Empty ? 0 : Convert.ToInt32(sizeno),
        //        SizeName = sizename,
        //        SizeDesc = desc,
        //        Status = status,
        //        CreatedDate = DateTime.Now
        //    };

            
        //    if(sizeno != "" && sizeno != null)
        //        productsizebl.Update(productsize);
        //    else
        //        productsizebl.Insert(productsize);
        //    Response.Redirect(Helpers.link.ToAdminProduct("ProductSize.aspx"));
        //}
    }
}